<?php
  require_once('tpl/header.php');
?>
 <?php 
    
    require_once('../system/loginCheck.php');
    require_once('../system/dbConn.php');
    connect();
    ?>
    <h1>欢迎管理员<?php echo $_SESSION["adminname"]; ?>使用本系统</h1>
    <?php 
    $vid=$_GET["vid"];
    $sql0="select * from videos where vid=$vid";
    $result0=mysql_query($sql0);//一条记录的结果集
    $row0=mysql_fetch_assoc($result0);//关联数组
     ?>
<form class="form-horizontal" action="doVideoUpdate.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="vid" value="<?php echo $vid; ?>">


  <div class="form-group">
    <label for="inputName" class="col-md-2 control-label">视频名称</label>
    <div class="col-md-6">
      <input type="text" class="form-control" id="inputName" value="<?php echo $row0["videoname"]; ?>" name="videoname">
    </div>
  </div>



  <div class="form-group">
    <label for="inputPassword3" class="col-md-2 control-label">视频类型</label>
    <div class="col-md-6">
    <?php 
    require_once('../system/dbConn.php');
    connect();
    $sql="select * from videotype";
    $result=mysql_query($sql);



     ?>
  <select class="form-control" name="videotype">
  <?php 
    while($row=mysql_fetch_assoc($result)){
    	?>
    	 <option value="<?php echo $row["tid"]; ?>" <?php if ($row0["tid"]==$row["tid"]) {
             echo "selected";
    	 } ?>>
    	 <?php echo $row["typename"]; ?>
    	 </option>
    	 <?php
    }
   ?>
</select>
</div>
    </div>

  <div class="form-group">
    <label for="inputBirthdate3" class="col-md-2 control-label">视频海报</label>
    <div class="col-md-8">
      <input type="file" id="inputBirthdate3" name="pic">
      原海报图片:<img src="../posters/<?php echo $row0["pic"]; ?>" width="80px"
      heigth="80px" class="img-circle">
    </div>
  </div>


  <div class="form-group">
    <label for="inputEmail3" class="col-md-2 control-label">视频简介</label>
    <div class="col-md-6">
    <textarea name="intro" id="" cols="80" rows="10"><?php echo $row0["intro"]; ?></textarea>
    </div>
  </div>

  <div class="form-group">
    <label for="inputEmail3" class="col-md-2 control-label">下载地址</label>
    <div class="col-md-6">
      <input type="text" class="form-control" value="<?php echo $row0["address"]; ?>" id="inputEmail3" name="address">
    </div>
  </div>


  <div class="form-group">
    <div class="col-md-offset-2 col-md-10">
    <input type="submit" class="btn btn-default" value="更新">
    </div>
  </div>
</form>

   


<?php
  require_once('tpl/footer.php');
?>